#include "../StdInc.h"

namespace GSTrader
{
	namespace Indicator
	{
		CIndicatorResult::CIndicatorResult()
		{
			m_strName = "";

			m_nLineWidth = 0;
			m_nPrecision = 0;	
			m_nShiftNum = 0;
			m_nStyle = 0;

			m_nColor = 0;
			m_pDataSeries = new CDataSeries;
		}

		CIndicatorResult::CIndicatorResult(const CIndicatorResult& l)
		{
			m_strName = l.m_strName;

			m_nLineWidth = l.m_nLineWidth;
			m_nPrecision = l.m_nPrecision;
			m_nShiftNum = l.m_nShiftNum;
			m_nStyle = l.m_nStyle;

			m_nColor = l.m_nColor;
			m_pDataSeries = new CDataSeries(l.m_pDataSeries);
		}

		CIndicatorResult::~CIndicatorResult()
		{
			_delete(m_pDataSeries)
		}

		double CIndicatorResult::GetValue(int nIndex)
		{
			return m_pDataSeries->GetValueByIndex(nIndex);
		}

		bool CIndicatorResult::SetValue(int nIndex, double dValue)
		{
			return m_pDataSeries->SetValue(nIndex, dValue);
		}

		void CIndicatorResult::Clear()
		{
			m_pDataSeries->Initialize();
		}
	}
}